﻿@using Smart.Project.Data
@model MProjectinfo
@{
    Layout = null;
}
<link href="~/Content/css/styles.css" rel="stylesheet" />
<link href="~/Content/css/styles-blue.css" rel="stylesheet" />
<link href="~/Content/css/bootstrap.min.css" rel="stylesheet" />
<link href="~/Content/css/new-styles.css" rel="stylesheet" />
<link href="~/Content/js/layui/css/layui.css" rel="stylesheet" />
<link href="~/Content/js/vendors/jsPanel/jquery.jspanel.css" rel="stylesheet" />

<script src="~/Content/js/vendors/jquery/jquery.min.js"></script>
<script src="~/Content/js/vendors/jquery/jquery-ui.min.js"></script>
<script src="~/Content/js/vendors/bootstrap/bootstrap.min.js"></script>
<script src="~/Content/js/vendors/form/jquery.form.min.js"></script>
<script src="~/Content/js/vendors/form/jquery.validate.min.js"></script>
<script src="~/Content/js/vendors/slimScroll/jquery.slimscroll.min.js"></script>
<script src="~/Content/js/layui/layui.js"></script>
<script src="~/Content/js/index.js"></script>
<script src="~/Content/js/vendors/jsPanel/jquery.jspanel.js"></script>
<script type="text/javascript">
    $(function () {
        //初始化laydate插件
        layui.use(["layer", "laydate"], function () {
            var laydate = layui.laydate;
            laydate.render({
                trigger: 'click', //采用click弹出
                elem: '#BEGINTIMETYPE',   //项目开始日期
                fomat: "yyyy-MM-dd"
            });
            laydate.render({
                elem: '#ENDTIMETYPE',   //结束日期
                trigger: 'click', //采用click弹出
                fomat: "yyyy-MM-dd"
            });
            laydate.render({
                elem: '#SIGNTIMETYPE',           //签订日期
                position: "fixed",
                trigger: 'click', //采用click弹出
                fomat:"yyyy-MM-dd"
            });
        })
        $("#slimScroll").slimScroll({
            height: "600px",
        });
        $.validator.addMethod("isPhone", function (value, element) {
            var length = value.length;
            var mobile = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\d{8})$/;
            return this.optional(element) || (length == 11 && mobile.test(value));
        }, "请填写正确的手机号码");//可以自定义默认提示信息
        $("#btnSave").click(function () {
            if ($("#mainForm").valid()) {
                $('#mainForm').ajaxSubmit(function (data) {
                    if (data == "true") {
                        parent.AlertInfo("添加成功！", "success");
                    } else if (data == "false") {
                        parent.AlertInfo("添加失败！", "error");
                    }
                    else {
                        parent.AlertInfo(data, "error");
                    }
                });
            }
        });
        /*查看帮助*/
        $("#btnUser").click(function () {
            //function DEPTView() {
            var parturl = path + "Department/UserHelp";
            UserInfo = $.jsPanel({
                resizable: "disabled",
                id: 'View',
                headerTitle: "用户信息帮助",
                content: '<iframe src="' + parturl + '" width="100%" height="100%" frameborder="0" />',
                position: 'center',
                contentSize: { width: 850, height: 350 },
                contentOverflow: 'hidden',
                theme: '#31435e',
                headerControls: {
                    controls: 'closeonly'
                }
            });
        });
        /*查看部门帮助*/
        $("#btnDEPTID").click(function () {
            //function DEPTView() {
            var parturl = path + "User/DetailHelp";
            ProInfo = $.jsPanel({
                resizable: "disabled",
                id: 'View',
                headerTitle: "部门信息帮助",
                content: '<iframe src="' + parturl + '" width="100%" height="100%" frameborder="0" />',
                position: 'center',
                contentSize: { width: 850, height: 400 },
                contentOverflow: 'hidden',
                theme: '#31435e',
                headerControls: {
                    controls: 'closeonly'
                }
            });
            //}
        });
    });
</script>
<div class="powerwidget" data-widget-editbutton="false" style="margin-bottom:0px">
    <div class="inner-spacer">
        <div id="slimScroll">
            @using (Html.BeginForm("Create", "Projectinfo", FormMethod.Post, new { @class = "form-horizontal", @id = "mainForm", @style = "margin-bottom:0px" }))
            {
            <fieldset>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="textinput">类别</label>
                    <div class="col-md-10">
                        @Html.HiddenFor(item => item.Id)
                        <select id="CATEGORY" name="CATEGORY" class="form-control">
                            <option value="1" selected="selected">承包</option>
                            <option value="0">分包</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="textinput">项目名称</label>
                    <div class="col-md-10">
                        @Html.TextBoxFor(item => item.NAME, new { @class = "form-control required" })
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="textinput">项目地址</label>
                    <div class="col-md-10">
                        @Html.TextBoxFor(item => item.ADDRESS, new { @class = "form-control required" })
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="textinput">项目开始时间</label>
                    <div class="col-md-10">
                        @Html.TextBoxFor(item => item.BEGINTIMETYPE, new { @class = "form-control required", @id = "BEGINTIMETYPE" })
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="textinput">项目结束时间</label>
                    <div class="col-md-10">
                        @Html.TextBoxFor(item => item.ENDTIMETYPE, new { @class = "form-control required", @id = "ENDTIMETYPE" })
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="textinput">项目类型编码</label>
                    <div class="col-md-10">
                        <select id="CATEGORY" name="CATEGORY" class="form-control">
                            <option value="1" selected="selected">在建项目</option>
                            <option value="0">虚拟项目</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="textinput">合同额</label>
                    <div class="col-md-9">
                        @Html.TextBoxFor(item => item.MONEY, new { @class = "form-control digits" })
                    </div>
                    <label class="col-md-1 control-label" for="textinput" style="text-align:left">万</label>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="textinput">部门</label>
                    <div class="col-md-8">
                        @Html.TextBoxFor(item => item.BMMC, new { @class = "form-control required", @id = "BMMC", @readonly = "readonly" })
                    </div>
                    <div class="col-md-2">
                        <button id="btnDEPTID" type="button" class="btn btn-success">选择</button>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="textinput">项目经理</label>
                    <div class="col-md-8">
                        @Html.TextBoxFor(item => item.PARTYA.USERNAME, new { @class = "form-control required", @id = "User", @readonly = "readonly" })
                    </div>
                    <div class="col-md-2">
                        <button id="btnUser" type="button" class="btn btn-success">选择</button>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="textinput">项目经理联系电话</label>
                    <div class="col-md-10">
                        @Html.TextBoxFor(item => item.PARTYB, new { @class = "form-control isPhone" })
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="textinput">阶段</label>
                    <div class="col-md-10">
                        <select id="STATUS" name="STATUS" class="form-control">
                            <option value="1" selected="selected">前期</option>
                            <option value="2">建设期</option>
                            <option value="3">运维期</option>
                            <option value="4">结束</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="textinput">合同编号</label>
                    <div class="col-md-10">
                        @Html.TextBoxFor(item => item.PARTYAPERSON, new { @class = "form-control required" })
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="textinput">项目甲方信息</label>
                    <div class="col-md-10">
                        @Html.TextBoxFor(item => item.JFINFO, new { @class = "form-control required" })
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="textinput">甲方负责人电话</label>
                    <div class="col-md-10">
                        @Html.TextBoxFor(item => item.PARTYAPHONE, new { @class = "form-control " })
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="textinput">条形码</label>
                    <div class="col-md-10">
                        @Html.TextBoxFor(item => item.BARCODE, new { @class = "form-control " })
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="textinput">签订时间</label>
                    <div class="col-md-10">
                        @Html.TextBoxFor(item => item.SIGNTIMETYPE, new { @class = "form-control required", @id = "SIGNTIMETYPE" })
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="textinput">描述</label>
                    <div class="col-md-10">
                        @Html.TextBoxFor(item => item.DESCRIBE, new { @class = "form-control " })
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="textinput">是否有效</label>
                    <div class="col-md-10">
                        <select id="ISVALID" name="ISVALID" class="form-control">
                            <option value="1" selected="selected">有效</option>
                            <option value="0">无效</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-12" style="text-align:center">
                        <button id="btnSave" type="button" class="btn btn-info">保存</button>
                    </div>
                </div>
                <div class="form-group" style="display:none">
                    <div class="col-md-8">
                        @Html.TextBoxFor(item => item.PARTYA.Id, new { @class = "form-control", @id = "UserID", @readonly = "readonly" })
                    </div>
                    <div class="col-md-8">
                        @Html.TextBoxFor(item => item.DEPT.Id, new { @class = "form-control", @id = "DEPTID", @readonly = "readonly" })
                    </div>
                </div>
            </fieldset>
            }
        </div>
    </div>
</div>


